<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC>
<html>
<head>
<base href="<%=basePath%>">

<title>商品详情</title>
<script src="js/jquery.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/bootstrap.js"></script>
<link rel="stylesheet" href="css/commodityDetails.css">
<script src="js/commodityDetails.js"></script>
<link rel="stylesheet" href="css/main.css">
<script type="text/javascript">
	$(function() {
		$("#report").click(function() {
			alert("已收到您的举报，我们即将处理");
		});
		$("#connectSeller").click(function() {
			window.open("http://localhost:8080/TradingPlatform/admin/chat.jsp");
		});
		
		$("#loginOut").click(function(){
			if(userId == "null"){
				window.location="admin/userLogin.jsp";
			};
			if(userId != "null"){
				window.location="login/loginOut.do";
			};
		});
	})
</script>


</head>

<body>
	<header></header>
	<div class="person-info container">
		<span>欢迎: ${userName}</span> &nbsp&nbsp&nbsp<a
			href="javaScript:void(0)" id="loginOut">${userName!=null ? '退出' : '登录'}</a>
		<input type="hidden" value="${userName}" id="userName">
		<div class="person-info-show"></div>
	</div>
	<nav class=" navbar-default nav-extends" role="navigation">
		<div class="container" style="margin-top:25px;">
			<div class="container-fluid">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed"
						data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only">Toggle navigation</span> <span
							class="icon-bar"></span> <span class="icon-bar"></span> <span
							class="icon-bar"></span>
					</button>
					<a class="brand" href="inquiry/all.do">科大二手交易平台</a>
				</div>

				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse "
					id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li class=""><a href="inquiry/all.do">首页</a></li>
						<li style="border-left:1px solid #CCCCCC;"><a
							href="http://s.ershou.taobao.com/">Link</a></li>
						<li style="border-left:1px solid #CCCCCC;"><a
							href="javaScript:void(0)" id="publishCommodity">发布闲置</a></li>
						<li style="border-left:1px solid #CCCCCC;"><a
							href="userInfo/searchProduct.do" id="publishCommodity">我的二手</a></li>
					</ul>
					<form class="navbar-form navbar-right" role="search"
						action="inquiry/search.do" method="post">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="输入商品名，或@用户名"
								name="searchInput" value="${searchInput}">
						</div>
						<button type="submit" class="btn btn-default ">
							查询 <span class="glyphicon glyphicon-search"></span>
						</button>
					</form>
				</div>
				<!-- /.navbar-collapse -->
			</div>
			<!-- /.container-fluid -->
		</div>
	</nav>


	<section class="container">
		<header class="business-head">
			<div class="business-info fl">
				<img src="${user.userAvatar }" alt=""> <a
					href="inquiry/user/${user.userName}.do">${user.userName }</a>
			</div>
			<div class="check fl">
				<div class="check-time fl checked">
					<label>宝贝浏览次数</label> <br> <span><b>100</b></span>
				</div>
				<div class="change-time fl checked">
					<label>最近编辑时间</label> <br> <span><i>${product.uploadDate}</i></span>
				</div>
			</div>

			<a href="javaScript:void(0)" class="fr report" id="report">举报该宝贝</a>
		</header>


		<section class=details-info>
			<div class="details-left fl">
				<div class="focus-pic">
					<div class="focus-pic-middle">
						<div class="pic-window">
							<div class="outside-box" id="outsideBox" style="top:0;left:0;">
								<!-- <div class="pic-outside-box">
                                    <img src="img/test.jpg" alt="">
                                </div>
                                <div class="pic-outside-box">
                                    <img src="img/test3.jpg" alt="">
                                </div>
                                <div class="pic-outside-box">
                                    <img src="img/test4.jpg" alt="">
                                </div> -->
								<c:forEach items="${productImages}" var="images">
									<div class="pic-outside-box">
										<img src="${images.imageName }" alt="">
									</div>
								</c:forEach>

							</div>
							<!--left right button-->
							<div class="prev-button window-btn" id="prev">
								<span class="glyphicon glyphicon-chevron-left"></span>
							</div>
							<div class="next-button window-btn" id="next">
								<span class="glyphicon glyphicon-chevron-right"></span>
							</div>
						</div>
					</div>
					<div class="focus-pic-small">

						<c:forEach items="${productImages}" var="images">
							<img src="${images.imageName }" alt="dfafad">
						</c:forEach>

					</div>
				</div>
				<div class="word-info">
					<div class="word-title">
						<span class="fl word-title-span" id="wordTitle-1"><b>宝贝介绍</b></span>
						<span class="fl word-title-span word-title-active"
							id="wordTitle-2"><b>留言<label>0</label></b></span>
					</div>
					<section class="word-section">
						<div class="word-section-info">
							<h4>
								<b>宝贝介绍</b>
							</h4>
							<div>${product.productDescription }</div>
						</div>
						<div class="word-section-info">
							<h4>
								<b>留言</b>
							</h4>
							<div class="leave-message-list"></div>
						</div>
					</section>
				</div>
			</div>
			<div class="details-right fl">
				<div class="sell-info">
					<h3>
						<b>${product.productName } </b>
					</h3>
					<p>
						<span>转卖价:</span><label class="sell-info-worth">&yen; ${ product.currentPrice eq null ? '你来定' : product.currentPrice }</label>
					</p>
					<p>
						<span>原价:<s>&yen; ${ product.originalPrice eq null ? '忘记了' : product.originalPrice }</s></span>
					</p>
					<hr>
					<p>
						<span>成色:</span><span>&nbsp ${product.productCondition }</span>
					</p>
					<p>
						<span>所在地:</span><span>&nbsp ${user.userLocation }</span>
					</p>
					<p>
						<span>联系方式:</span><span>&nbsp ${user.userPhone}</span>
					</p>
					<button class="btn btn-primary  btn-lg" id="connectSeller">&nbsp联系卖家</button>
					<br>
					<!--<button>分享<em>0</em></button>
                    <button>赞<em>0</em></button>-->
				</div>

				<div class="more-sell">
					卖家的其他闲置 <a href="inquiry/user/${user.userName}.do">更多</a>
				</div>
			</div>
		</section>
	</section>

	<footer></footer>
</body>
</html>
